<div class="r_crumbs">
  <a href="javascript:;">首页</a>
  <a href="javascript:;">机器人管理</a>
  逻辑管理
</div>
<div class="r_main">
  <app-alert></app-alert>
  <div class="r_box">
    <div class="r_boxHead">
      <h2>逻辑基点管理</h2>
    </div>
    <div class="r_boxContent">
      <div class="r_boxTool clearfix">
        <div class="r_boxToolFl">
          <div class="row">
            <div class="col-md-4 col-sm-5 ">
              <div class="r_boxToolPad">
                <div class="input-group">
                  <div class="form-control pull-right" style="border: none;background: #f0f7fd;"></div>
                  <select class="input-group-addon" name="" (change)="queryListPath($event.target.value)"
                          [(ngModel)]="curlogicInfo.mapId">
                    <option value="" selected>请选择地图</option>
                    <option *ngFor="let obj of logic" value="{{obj.mapId}}">{{obj.name}}</option>

                  </select>
                  <!--<span class="input-group-addon" ><i class="fa fa-search"></i></span>-->
                </div>
              </div>
            </div>
            <div class="col-md-4 col-sm-5 ">
              <div class="r_boxToolPad">
                <div class="input-group">
                  <div class="form-control pull-right" style="border: none;background: #f0f7fd;"></div>
                  <select class="input-group-addon" name="" id="" [(ngModel)]="curlogicInfo.pathId"
                          (click)="selectPath()" (change)="getId($event.target.value)">
                    <option value="" selected>请选择路径</option>
                    <option *ngFor="let obj of path" value="{{obj.id}}">{{obj.name}}</option>
                  </select>
                  <!--<span class="input-group-addon" ><i class="fa fa-search"></i></span>-->
                </div>
              </div>
            </div>
          </div>
        </div>
        <div class="r_boxToolFRl">
          <button type="button" data-toggle="modal" data-target="#myModal" class="btn btn-primary"
                  (click)="onAddLogic()"><i class="fa fa-plus"></i> 新增
          </button>
        </div>
      </div>
      <div>
        <div class="r_boxPad">
          <div class="table-responsive">
            <table class="table table-striped table-bordered table-hover">
              <thead>
              <tr>
                <th>排序</th>
                <th>编号</th>
                <th>逻辑基点名称</th>
                <th>物理基点名称</th>
                <th>路径名称</th>
                <th width="120">操作</th>
              </tr>
              </thead>
              <tbody>
              <tr *ngFor="let item of logicInfo">
                <td>{{item.sort}}</td>
                <td>{{item.nodeId}}</td>
                <td>{{item.logicName}}</td>
                <td>{{item.realName}}</td>
                <td>{{item.pathName}}</td>
                <td style="text-align: center;">
                  <div class="tabledit-toolbar btn-toolbar" style=" display: inline-block;">
                    <div class="btn-group btn-group-sm">
                      <button class="tabledit-edit-button btn btn-sm btn-default" type="button"
                              (click)="onEditLogic(item)">编辑
                      </button>
                      <button class="tabledit-delete-button btn btn-sm btn-default" type="button"
                              (click)="onDeleteLogic(item)">删除
                      </button>
                    </div>
                  </div>
                </td>
              </tr>
              </tbody>
            </table>
          </div>
        </div>
        <app-pagination [currentPage]="curPage" [totalPages]="logicInfoPage?.totalPages"
                        (clickPage)="onPage($event)"></app-pagination>
      </div>
    </div>
  </div>
</div>
<!-- 删除 -->
<div id="delete_confirm" class="modal fade  bs-example-modal-lg" role="dialog">
  <div class="modal-dialog modal-lg" role="document">
    <div class="modal-content">

      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
          aria-hidden="true">&times;</span></button>
        <h4 class="modal-title">是否确定删除该信息?</h4>
      </div>
      <div class="modal-body">
        <div class="table-responsive">
          <table class="table table-bordered">
            <thead>
            <tr>
              <th>排序</th>
              <th>编号</th>
              <th>逻辑基点名称</th>
              <th>物理基点名称</th>
              <th>动作类型</th>
              <th>路径名称</th>
            </tr>
            </thead>
            <tbody>
            <tr>
              <td>{{curlogicInfo.sort}}</td>
              <td>{{curlogicInfo.nodeId}}</td>
              <td>{{curlogicInfo.logicName}}</td>
              <td>{{curlogicInfo.realName}}</td>
              <td>{{curlogicInfo.type}}</td>
              <td>{{curlogicInfo.pathName}}</td>
            </tr>
            </tbody>
          </table>
        </div>
      </div>
      <div class="modal-footer" style="text-align: right;">
        <button type="button" class="btn btn-primary" (click)="delete()">确定</button>
        <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
      </div>
    </div>
  </div>
</div>

